﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace b3.埃氏筛选法
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int i, j;
            int[] count = new int[101];
            for (i = 0; i <= 100; i++)
                count[i] = 1;
            for (i = 2; i*i <= 100; i++)
            {
                for (j = 2 * i; j <=100; j = j + i)
                {
                    count[j] = 0;
                }
            }
            Console.Write("2到100内的素数为：\n");
            for (i = 2; i <= 100; i++)
            {
                if (count[i] == 1)
                {
                    Console.Write(i.ToString());
                    Console.Write("\n");
                }
            }
        }
    }
}
